

typedef VODUploadCallbackOnUploadSucceed = Function(UploadFileInfo info);

typedef VODUploadCallbackOnUploadFailed = Function(UploadFileInfo info, String code, String message);

typedef VODUploadCallbackOnUploadProgress = Function(UploadFileInfo info, int uploadedSize, int totalSize);

typedef VODUploadCallbackOnUploadTokenExpired = Function();

typedef VODUploadCallbackOnUploadRetry = Function(String code, String message);

typedef VODUploadCallbackOnUploadRetryResume = Function();

typedef VODUploadCallbackOnUploadStarted = Function(UploadFileInfo uploadFileInfo);


class VODUploadCallback{

  VODUploadCallback(
  this.onUploadStarted,
  {
    this.onUploadSucceed,
    this.onUploadFailed,
    this.onUploadProgress,
    this.onUploadTokenExpired,
    this.onUploadRetry,
    this.onUploadRetryResume,
});


  VODUploadCallbackOnUploadSucceed onUploadSucceed;

  VODUploadCallbackOnUploadFailed onUploadFailed;

  VODUploadCallbackOnUploadProgress onUploadProgress;

  VODUploadCallbackOnUploadTokenExpired onUploadTokenExpired;

  VODUploadCallbackOnUploadRetry onUploadRetry;

  VODUploadCallbackOnUploadRetryResume onUploadRetryResume;

  VODUploadCallbackOnUploadStarted onUploadStarted;


}


class UploadFileInfo {
  static final int UPLOAD_FILE_TYPE_IMAGE = 0;
  static final int UPLOAD_FILE_TYPE_VIDEO = 1;
  String filePath;
  String endpoint;
  String bucket;
  String object;
  VodInfo vodInfo;
  UploadStateType status;
  int fileType = 1;
}

class VodInfo {
  String title;
  String desc;
  int cateId;
  List<String> tags;
  String userData;
  String coverUrl;
  bool isProcess = true;
  bool isShowWaterMark;
  int priority;
  String fileName;
  String fileSize;
}

enum UploadStateType {
  INIT,
  UPLOADING,
  SUCCESS,
  FAIlURE,
  CANCELED,
  PAUSING,
  PAUSED,
  DELETED
}
